DateAdd

Adds a time to a date/time value and returns the resulting value in the short date and time format used on the test computer. Formatting depends on the operating system's regional settings.

Syntax

DateAdd("IntervalType", Amount, "DateTimeString")

Arguments

Argument Description
IntervalType Time interval type.
Amount Amount of the specified time interval to add.
DateTimeString Any date/time expression. See Date/time format examples for valid formats.

Interval types

String Interval type
d Day
y Day of year
h Hour
n Minute
m Month
q Quarter
s Second
w Weekday
ww Week of year (seven days)
yyyy Year

Return value

Value Description
Value Date/time value with the amount of time added.

Example

NewDate = DateAdd("m", 1, "3-July-2016")